home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Updaters / Symantec C++⁄MPW 6.0.1 / SCpp 6.0.1 Update / SCIncludes / QuickTimeComponents.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-27  |  59.5 KB  |  1,505 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Wednesday, October 21, 1992 at 2:55 PM
  4.  QuickTimeComponents.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.  
  8.  Copyright Apple Computer, Inc. 1991, 1992
  9.  All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __QUICKTIMECOMPONENTS__
  15. #define __QUICKTIMECOMPONENTS__
  16.  
  17. #ifndef __COMPONENTS__
  18. #include <Components.h>
  19. #endif
  20.  
  21. #ifndef __IMAGECOMPRESSION__
  22. #include <ImageCompression.h>
  23. #endif
  24.  
  25. #ifndef __MOVIES__
  26. #include <Movies.h>
  27. #endif
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <QuickDraw.h>
  31. #endif
  32.  
  33. #ifndef __VIDEO__
  34. #include <Video.h>
  35. #endif
  36.  
  37.  
  38.     #define clockComponentType         'clok'
  39.     #define systemTickClock         'tick'            /* subtype: 60ths since boot        */
  40.     #define systemSecondClock        'seco'            /* subtype: seconds since 1904        */
  41.     #define systemMillisecondClock    'mill'            /* subtype: 1000ths since boot        */
  42.     #define systemMicrosecondClock    'micr'            /* subtype: 1000000ths since boot    */
  43.     
  44.     enum {
  45.         kClockRateIsLinear = 1,
  46.         kClockImplementsCallBacks = 2
  47.     };
  48.     
  49.     #define ClockGetTime GetClockTime
  50.  
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif __cplusplus
  55.  
  56. /** These are Clock procedures **/
  57.  
  58. pascal ComponentResult ClockGetTime (ComponentInstance aClock, TimeRecord *out)  = {0x2F3C,0x4,0x1,0x7000,0xA82A};
  59.  
  60. pascal QTCallBack ClockNewCallBack (ComponentInstance aClock, TimeBase tb, short callBackType)  = {0x2F3C,0x6,0x2,0x7000,0xA82A};
  61.  
  62. pascal ComponentResult ClockDisposeCallBack (ComponentInstance aClock, QTCallBack cb)  = {0x2F3C,0x4,0x3,0x7000,0xA82A};
  63.  
  64. pascal ComponentResult ClockCallMeWhen (ComponentInstance aClock, QTCallBack cb, long param1, long param2, long param3)  = {0x2F3C,0x10,0x4,0x7000,0xA82A};
  65.  
  66. pascal ComponentResult ClockCancelCallBack (ComponentInstance aClock, QTCallBack cb)  = {0x2F3C,0x4,0x5,0x7000,0xA82A};
  67.  
  68. pascal ComponentResult ClockRateChanged (ComponentInstance aClock, QTCallBack cb)  = {0x2F3C,0x4,0x6,0x7000,0xA82A};
  69.  
  70. pascal ComponentResult ClockTimeChanged (ComponentInstance aClock, QTCallBack cb)  = {0x2F3C,0x4,0x7,0x7000,0xA82A};
  71.  
  72. pascal ComponentResult ClockSetTimeBase (ComponentInstance aClock, TimeBase tb)  = {0x2F3C,0x4,0x8,0x7000,0xA82A};
  73.  
  74. pascal ComponentResult ClockStartStopChanged (ComponentInstance aClock, QTCallBack cb, Boolean startChanged, Boolean stopChanged)  = {0x2F3C,0x8,0x9,0x7000,0xA82A};
  75.  
  76. pascal ComponentResult ClockGetRate (ComponentInstance aClock, Fixed *rate)  = {0x2F3C,0x4,0xA,0x7000,0xA82A};
  77.  
  78. #ifdef __cplusplus
  79. }
  80. #endif __cplusplus
  81. enum {
  82.     kClockGetTimeSelect = 0x1,
  83.     kClockNewCallBackSelect = 0x2,
  84.     kClockDisposeCallBackSelect = 0x3,
  85.     kClockCallMeWhenSelect = 0x4,
  86.     kClockCancelCallBackSelect = 0x5,
  87.     kClockRateChangedSelect = 0x6,
  88.     kClockTimeChangedSelect = 0x7,
  89.     kClockSetTimeBaseSelect = 0x8,
  90.     kClockStartStopChangedSelect = 0x9,
  91.     kClockGetRateSelect = 0xA 
  92. };
  93.  
  94.     /*
  95.         General Sequence Grab stuff
  96.     */
  97.     
  98.     typedef ComponentInstance SeqGrabComponent;
  99.     
  100.     typedef ComponentInstance SGChannel;
  101.     
  102.     #define SeqGrabComponentType 'barg'
  103.     #define SeqGrabChannelType 'sgch'
  104.     #define SeqGrabPanelType 'sgpn'
  105.  
  106.     #define SeqGrabCompressionPanelType 'comp'
  107.     #define SeqGrabSourcePanelType 'sour'
  108.  
  109.     enum {
  110.         seqGrabToDisk = 1,
  111.         seqGrabToMemory = 2,
  112.         seqGrabDontUseTempMemory = 4,
  113.         seqGrabAppendToFile = 8,
  114.         seqGrabDontAddMovieResource = 16,
  115.         seqGrabDontMakeMovie = 32,
  116.         seqGrabPreExtendFile = 64
  117.     };
  118.     typedef unsigned long SeqGrabDataOutputEnum;
  119.  
  120.     enum {
  121.         seqGrabRecord = 1,
  122.         seqGrabPreview = 2,
  123.         seqGrabPlayDuringRecord = 4
  124.     };
  125.     typedef unsigned long SeqGrabUsageEnum;
  126.  
  127.     enum {
  128.         seqGrabHasBounds = 1,
  129.         seqGrabHasVolume = 2,
  130.         seqGrabHasDiscreteSamples = 4
  131.     };
  132.     typedef unsigned long SeqGrabChannelInfoEnum;
  133.  
  134.     typedef struct seqGrabFrameInfo {
  135.         long        frameOffset;
  136.         long        frameTime;
  137.         long        frameSize;
  138.         SGChannel    frameChannel;
  139.         long        frameRefCon;
  140.     } seqGrabFrameInfo;
  141.     
  142.     enum {
  143.         grabPictOffScreen = 1,
  144.         grabPictIgnoreClip = 2
  145.     };
  146.     #define sgFlagControlledGrab (1)
  147.  
  148.     typedef pascal OSErr (*SGDataProc)(SGChannel c, Ptr p, long len, long *offset, long chRefCon,
  149.                 TimeValue time, short writeType, long refCon);
  150.  
  151.     typedef struct SGDeviceName {
  152.         Str63            name;
  153.         Handle            icon;
  154.         long            flags;
  155.         long            refCon;
  156.         long            reserved;        // zero
  157.     } SGDeviceName;
  158.  
  159.     #define sgDeviceNameFlagDeviceUnavailable (1)
  160.  
  161.     typedef struct SGDeviceListRecord {
  162.         short            count;
  163.         short            selectedIndex;
  164.         long            reserved;        // zero
  165.         SGDeviceName    entry[1];
  166.     } SGDeviceListRecord, *SGDeviceListPtr, **SGDeviceList;
  167.  
  168.     #define sgDeviceListWithIcons (1)
  169.     #define sgDeviceListDontCheckAvailability (2)
  170.  
  171.     enum {
  172.         seqGrabWriteAppend,
  173.         seqGrabWriteReserve,
  174.         seqGrabWriteFill
  175.     };
  176.  
  177.     enum {
  178.         seqGrabUnpause = 0,
  179.         seqGrabPause = 1,
  180.         seqGrabPauseForMenu = 3
  181.     };
  182.     enum {
  183.         channelFlagDontOpenResFile = 2,
  184.         channelFlagHasDependency = 4
  185.     };
  186.  
  187.     typedef pascal Boolean (*SGModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent,
  188.                 short *itemHit, long refCon);
  189.  
  190.     enum {
  191.         sgPanelFlagForPanel = 1
  192.     };
  193.  
  194.  
  195.  
  196.     #define channelPlayNormal 0
  197.     #define channelPlayFast 1
  198.     #define channelPlayHighQuality 2
  199.     #define channelPlayAllData 4
  200.  
  201. #ifdef __cplusplus
  202. extern "C" {
  203. #endif __cplusplus
  204. pascal ComponentResult SGInitialize (SeqGrabComponent s)  = {0x2F3C,0,0x1,0x7000,0xA82A};
  205.  
  206. pascal ComponentResult SGSetDataOutput (SeqGrabComponent s, FSSpec *movieFile, long whereFlags)  = {0x2F3C,0x8,0x2,0x7000,0xA82A};
  207.     
  208. pascal ComponentResult SGGetDataOutput (SeqGrabComponent s, FSSpec *movieFile, long *whereFlags)  = {0x2F3C,0x8,0x3,0x7000,0xA82A};
  209.  
  210. pascal ComponentResult SGSetGWorld (SeqGrabComponent s, CGrafPtr gp, GDHandle gd)  = {0x2F3C,0x8,0x4,0x7000,0xA82A};
  211. pascal ComponentResult SGGetGWorld (SeqGrabComponent s, CGrafPtr *gp, GDHandle *gd)  = {0x2F3C,0x8,0x5,0x7000,0xA82A};
  212.  
  213. pascal ComponentResult SGNewChannel (SeqGrabComponent s, OSType channelType, SGChannel *ref)  = {0x2F3C,0x8,0x6,0x7000,0xA82A};
  214. pascal ComponentResult SGDisposeChannel (SeqGrabComponent s, SGChannel c)  = {0x2F3C,0x4,0x7,0x7000,0xA82A};
  215.  
  216. pascal ComponentResult SGStartPreview (SeqGrabComponent s)  = {0x2F3C,0,0x10,0x7000,0xA82A};
  217. pascal ComponentResult SGStartRecord (SeqGrabComponent s)  = {0x2F3C,0,0x11,0x7000,0xA82A};
  218. pascal ComponentResult SGIdle (SeqGrabComponent s)  = {0x2F3C,0,0x12,0x7000,0xA82A};
  219. pascal ComponentResult SGStop (SeqGrabComponent s)  = {0x2F3C,0,0x13,0x7000,0xA82A};
  220.  
  221. pascal ComponentResult SGPause (SeqGrabComponent s, Byte pause)  = {0x2F3C,0x2,0x14,0x7000,0xA82A};
  222.  
  223. pascal ComponentResult SGPrepare (SeqGrabComponent s, Boolean prepareForPreview, Boolean prepareForRecord)  = {0x2F3C,0x4,0x15,0x7000,0xA82A};
  224. pascal ComponentResult SGRelease (SeqGrabComponent s)  = {0x2F3C,0,0x16,0x7000,0xA82A};
  225.  
  226. pascal Movie SGGetMovie (SeqGrabComponent s)  = {0x2F3C,0,0x17,0x7000,0xA82A};
  227.  
  228. pascal ComponentResult SGSetMaximumRecordTime (SeqGrabComponent s, unsigned long ticks)  = {0x2F3C,0x4,0x18,0x7000,0xA82A};
  229. pascal ComponentResult SGGetMaximumRecordTime (SeqGrabComponent s, unsigned long *ticks)  = {0x2F3C,0x4,0x19,0x7000,0xA82A};
  230.  
  231. pascal ComponentResult SGGetStorageSpaceRemaining (SeqGrabComponent s, unsigned long *bytes)  = {0x2F3C,0x4,0x1A,0x7000,0xA82A};
  232. pascal ComponentResult SGGetTimeRemaining (SeqGrabComponent s, long *ticksLeft)  = {0x2F3C,0x4,0x1B,0x7000,0xA82A};
  233.  
  234. pascal ComponentResult SGGrabPict (SeqGrabComponent s, PicHandle *p, const Rect *bounds,
  235.                 short offscreenDepth, long grabPictFlags)  = {0x2F3C,0xE,0x1C,0x7000,0xA82A};
  236.  
  237. pascal ComponentResult SGGetLastMovieResID (SeqGrabComponent s, short *resID)  = {0x2F3C,0x4,0x1D,0x7000,0xA82A};
  238.  
  239. pascal ComponentResult SGSetFlags (SeqGrabComponent s, long sgFlags)  = {0x2F3C,0x4,0x1E,0x7000,0xA82A};
  240.  
  241. pascal ComponentResult SGGetFlags (SeqGrabComponent s, long *sgFlags)  = {0x2F3C,0x4,0x1F,0x7000,0xA82A};
  242.  
  243. pascal ComponentResult SGSetDataProc (SeqGrabComponent s, SGDataProc proc, long refCon)  = {0x2F3C,0x8,0x20,0x7000,0xA82A};
  244.  
  245. pascal ComponentResult SGNewChannelFromComponent (SeqGrabComponent s, SGChannel *newChannel, Component sgChannelComponent)  = {0x2F3C,0x8,0x21,0x7000,0xA82A};
  246.  
  247. pascal ComponentResult SGDisposeDeviceList (SeqGrabComponent s, SGDeviceList list)  = {0x2F3C,0x4,0x22,0x7000,0xA82A};
  248.  
  249. pascal ComponentResult SGAppendDeviceListToMenu (SeqGrabComponent s, SGDeviceList list, MenuHandle mh)  = {0x2F3C,0x8,0x23,0x7000,0xA82A};
  250.  
  251. pascal ComponentResult SGSetSettings (SeqGrabComponent s, UserData ud, long flags)  = {0x2F3C,0x8,0x24,0x7000,0xA82A};
  252.  
  253. pascal ComponentResult SGGetSettings (SeqGrabComponent s, UserData *ud, long flags)  = {0x2F3C,0x8,0x25,0x7000,0xA82A};
  254.  
  255. pascal ComponentResult SGGetIndChannel (SeqGrabComponent s, short index, SGChannel *ref, OSType *chanType)  = {0x2F3C,0xA,0x26,0x7000,0xA82A};
  256.  
  257. pascal ComponentResult SGUpdate (SeqGrabComponent s, RgnHandle updateRgn)  = {0x2F3C,0x4,0x27,0x7000,0xA82A};
  258.  
  259. pascal ComponentResult SGGetPause (SeqGrabComponent s, Byte *paused)  = {0x2F3C,0x4,0x28,0x7000,0xA82A};
  260.  
  261. pascal ComponentResult SGSettingsDialog (SeqGrabComponent s, SGChannel c, short numPanels, Component *panelList, long flags, SGModalFilterProcPtr proc, long procRefNum)  = {0x2F3C,0x16,0x29,0x7000,0xA82A};
  262.  
  263. pascal ComponentResult SGGetAlignmentProc (SeqGrabComponent s, AlignmentProcRecordPtr alignmentProc)  = {0x2F3C,0x4,0x2A,0x7000,0xA82A};
  264.  
  265. pascal ComponentResult SGSetChannelSettings (SeqGrabComponent s, SGChannel c, UserData ud, long flags)  = {0x2F3C,0xC,0x2B,0x7000,0xA82A};
  266.  
  267. pascal ComponentResult SGGetChannelSettings (SeqGrabComponent s, SGChannel c, UserData *ud, long flags)  = {0x2F3C,0xC,0x2C,0x7000,0xA82A};
  268.  
  269.  
  270.  
  271. /*
  272.     calls from Channel to seqGrab
  273. */
  274.  
  275. pascal ComponentResult SGWriteMovieData (SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset)  = {0x2F3C,0x10,0x100,0x7000,0xA82A};
  276. pascal ComponentResult SGAddFrameReference (SeqGrabComponent s, seqGrabFrameInfo *frameInfo)  = {0x2F3C,0x4,0x101,0x7000,0xA82A};
  277. pascal ComponentResult SGGetNextFrameReference (SeqGrabComponent s, seqGrabFrameInfo *frameInfo,
  278.                     TimeValue *frameDuration, long *frameNumber)  = {0x2F3C,0xC,0x102,0x7000,0xA82A};
  279. pascal ComponentResult SGGetTimeBase (SeqGrabComponent s, TimeBase *tb)  = {0x2F3C,0x4,0x103,0x7000,0xA82A};
  280. pascal ComponentResult SGSortDeviceList (SeqGrabComponent s, SGDeviceList list)  = {0x2F3C,0x4,0x104,0x7000,0xA82A};
  281. pascal ComponentResult SGAddMovieData (SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType)  = {0x2F3C,0x1A,0x105,0x7000,0xA82A};
  282. pascal ComponentResult SGChangedSource (SeqGrabComponent s, SGChannel c)  = {0x2F3C,0x4,0x106,0x7000,0xA82A};
  283.  
  284.  
  285. /*** Sequence Grab CHANNEL Component Stuff ***/
  286.  
  287. pascal ComponentResult SGSetChannelUsage (SGChannel c, long usage)  = {0x2F3C,0x4,0x80,0x7000,0xA82A};
  288. pascal ComponentResult SGGetChannelUsage (SGChannel c, long *usage)  = {0x2F3C,0x4,0x81,0x7000,0xA82A};
  289.  
  290. pascal ComponentResult SGSetChannelBounds (SGChannel c, const Rect *bounds)  = {0x2F3C,0x4,0x82,0x7000,0xA82A};
  291. pascal ComponentResult SGGetChannelBounds (SGChannel c, Rect *bounds)  = {0x2F3C,0x4,0x83,0x7000,0xA82A};
  292.  
  293. pascal ComponentResult SGSetChannelVolume (SGChannel c, short volume)  = {0x2F3C,0x2,0x84,0x7000,0xA82A};
  294. pascal ComponentResult SGGetChannelVolume (SGChannel c, short *volume)  = {0x2F3C,0x4,0x85,0x7000,0xA82A};
  295.  
  296. pascal ComponentResult SGGetChannelInfo (SGChannel c, long *channelInfo)  = {0x2F3C,0x4,0x86,0x7000,0xA82A};
  297.  
  298. pascal ComponentResult SGSetChannelPlayFlags (SGChannel c, long playFlags)  = {0x2F3C,0x4,0x87,0x7000,0xA82A};
  299. pascal ComponentResult SGGetChannelPlayFlags (SGChannel c, long *playFlags)  = {0x2F3C,0x4,0x88,0x7000,0xA82A};
  300.  
  301. pascal ComponentResult SGSetChannelMaxFrames (SGChannel c, long frameCount)  = {0x2F3C,0x4,0x89,0x7000,0xA82A};
  302. pascal ComponentResult SGGetChannelMaxFrames (SGChannel c, long *frameCount)  = {0x2F3C,0x4,0x8A,0x7000,0xA82A};
  303.  
  304. pascal ComponentResult SGSetChannelRefCon (SGChannel c, long refCon)  = {0x2F3C,0x4,0x8B,0x7000,0xA82A};
  305.  
  306. pascal ComponentResult SGSetChannelClip (SGChannel c, RgnHandle theClip)  = {0x2F3C,0x4,0x8C,0x7000,0xA82A};
  307.  
  308. pascal ComponentResult SGGetChannelClip (SGChannel c, RgnHandle *theClip)  = {0x2F3C,0x4,0x8D,0x7000,0xA82A};
  309.  
  310. pascal ComponentResult SGGetChannelSampleDescription (SGChannel c, Handle sampleDesc)  = {0x2F3C,0x4,0x8E,0x7000,0xA82A};
  311.  
  312. pascal ComponentResult SGGetChannelDeviceList (SGChannel c, long selectionFlags, SGDeviceList *list)  = {0x2F3C,0x8,0x8F,0x7000,0xA82A};
  313.  
  314. pascal ComponentResult SGSetChannelDevice (SGChannel c, StringPtr name)  = {0x2F3C,0x4,0x90,0x7000,0xA82A};
  315.  
  316. pascal ComponentResult SGSetChannelMatrix (SGChannel c, const MatrixRecord *m)  = {0x2F3C,0x4,0x91,0x7000,0xA82A};
  317.  
  318. pascal ComponentResult SGGetChannelMatrix (SGChannel c, MatrixRecord *m)  = {0x2F3C,0x4,0x92,0x7000,0xA82A};
  319.  
  320. pascal ComponentResult SGGetChannelTimeScale (SGChannel c, TimeScale *scale)  = {0x2F3C,0x4,0x93,0x7000,0xA82A};
  321.  
  322. /*
  323.     calls from seqGrab to Channel
  324. */
  325.  
  326. pascal ComponentResult SGInitChannel (SGChannel c, SeqGrabComponent owner)  = {0x2F3C,0x4,0x180,0x7000,0xA82A};
  327. pascal ComponentResult SGWriteSamples (SGChannel c, Movie m, AliasHandle theFile)  = {0x2F3C,0x8,0x181,0x7000,0xA82A};
  328. pascal ComponentResult SGGetDataRate (SGChannel c, long *bytesPerSecond)  = {0x2F3C,0x4,0x182,0x7000,0xA82A};
  329. pascal ComponentResult SGAlignChannelRect (SGChannel c, Rect *r)  = {0x2F3C,0x4,0x183,0x7000,0xA82A};
  330.  
  331. /*
  332.     Dorky dialog panel calls
  333. */
  334.  
  335. pascal ComponentResult SGPanelGetDitl (SeqGrabComponent s, Handle *ditl)  = {0x2F3C,0x4,0x200,0x7000,0xA82A};
  336. pascal ComponentResult SGPanelGetTitle (SeqGrabComponent s, Str255 title)  = {0x2F3C,0x4,0x201,0x7000,0xA82A};
  337. pascal ComponentResult SGPanelCanRun (SeqGrabComponent s, SGChannel c)  = {0x2F3C,0x4,0x202,0x7000,0xA82A};
  338. pascal ComponentResult SGPanelInstall (SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)  = {0x2F3C,0xA,0x203,0x7000,0xA82A};
  339. pascal ComponentResult SGPanelEvent (SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset,
  340.         EventRecord *theEvent, short *itemHit, Boolean *handled)  = {0x2F3C,0x16,0x204,0x7000,0xA82A};
  341. pascal ComponentResult SGPanelItem (SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset, short itemNum)  = {0x2F3C,0xC,0x205,0x7000,0xA82A};
  342. pascal ComponentResult SGPanelRemove (SeqGrabComponent s, SGChannel c, DialogPtr d, short itemOffset)  = {0x2F3C,0xA,0x206,0x7000,0xA82A};
  343. pascal ComponentResult SGPanelSetGrabber (SeqGrabComponent s, SeqGrabComponent sg)  = {0x2F3C,0x4,0x207,0x7000,0xA82A};
  344. pascal ComponentResult SGPanelSetResFile (SeqGrabComponent s, short resRef)  = {0x2F3C,0x2,0x208,0x7000,0xA82A};
  345. pascal ComponentResult SGPanelGetSettings (SeqGrabComponent s, SGChannel c, UserData *ud, long flags)  = {0x2F3C,0xC,0x209,0x7000,0xA82A};
  346. pascal ComponentResult SGPanelSetSettings (SeqGrabComponent s, SGChannel c, UserData ud, long flags)  = {0x2F3C,0xC,0x20A,0x7000,0xA82A};
  347. pascal ComponentResult SGPanelValidateInput (SeqGrabComponent s, Boolean *ok)  = {0x2F3C,0x4,0x20B,0x7000,0xA82A};
  348. #ifdef __cplusplus
  349. }
  350. #endif __cplusplus
  351.  
  352.  
  353. /*** Sequence Grab VIDEO CHANNEL Component Stuff ***/
  354.  
  355. /*
  356.     Video stuff
  357. */
  358.  
  359.     typedef struct SGCompressInfo {
  360.         Ptr                buffer;
  361.         unsigned long    bufferSize;
  362.         unsigned char    similarity;
  363.         unsigned char    reserved;
  364.     } SGCompressInfo;
  365.  
  366. typedef pascal ComponentResult (*GrabProc)(SGChannel c, short bufferNum, long refCon);
  367. typedef pascal ComponentResult (*GrabCompleteProc)(SGChannel c, short bufferNum, Boolean *done, long refCon);
  368.  
  369. typedef pascal ComponentResult (*DisplayProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  370.  
  371. typedef pascal ComponentResult (*CompressProc)(SGChannel c, short bufferNum, long refCon);
  372. typedef pascal ComponentResult (*CompressCompleteProc)(SGChannel c, short bufferNum,
  373.                                         Boolean *done, SGCompressInfo *ci, long refCon);
  374.  
  375. typedef pascal ComponentResult (*AddFrameProc)(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale,
  376.                             const SGCompressInfo *ci, long refCon);
  377.  
  378. typedef pascal ComponentResult (*TransferFrameProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  379.  
  380. typedef pascal ComponentResult (*GrabCompressCompleteProc)(SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *t, long refCon);
  381. typedef pascal ComponentResult (*DisplayCompressProc)(SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  382.  
  383.     struct VideoBottles {
  384.         short                        procCount;
  385.         GrabProc                    grabProc;
  386.         GrabCompleteProc            grabCompleteProc;
  387.         DisplayProc                    displayProc;
  388.         CompressProc                compressProc;
  389.         CompressCompleteProc        compressCompleteProc;
  390.         AddFrameProc                addFrameProc;
  391.         TransferFrameProc            transferFrameProc;
  392.         GrabCompressCompleteProc    grabCompressCompleteProc;
  393.         DisplayCompressProc            displayCompressProc;
  394.     };
  395.     typedef struct VideoBottles VideoBottles;
  396.  
  397.  
  398. #ifdef __cplusplus
  399. extern "C" {
  400. #endif __cplusplus
  401.  
  402. pascal ComponentResult SGGetSrcVideoBounds (SGChannel c, Rect *r)  = {0x2F3C,0x4,0x100,0x7000,0xA82A};
  403. pascal ComponentResult SGSetVideoRect (SGChannel c, Rect *r)  = {0x2F3C,0x4,0x101,0x7000,0xA82A};
  404. pascal ComponentResult SGGetVideoRect (SGChannel c, Rect *r)  = {0x2F3C,0x4,0x102,0x7000,0xA82A};
  405.  
  406. pascal ComponentResult SGGetVideoCompressorType (SGChannel c, OSType *compressorType)  = {0x2F3C,0x4,0x103,0x7000,0xA82A};
  407. pascal ComponentResult SGSetVideoCompressorType (SGChannel c, OSType compressorType)  = {0x2F3C,0x4,0x104,0x7000,0xA82A};
  408.  
  409. pascal ComponentResult SGSetVideoCompressor (SGChannel c, short depth, CompressorComponent compressor,
  410.             CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)  = {0x2F3C,0x12,0x105,0x7000,0xA82A};
  411. pascal ComponentResult SGGetVideoCompressor (SGChannel c, short *depth, CompressorComponent *compressor,
  412.             CodecQ *spatialQuality, CodecQ *temporalQuality, long *keyFrameRate)  = {0x2F3C,0x14,0x106,0x7000,0xA82A};
  413.  
  414. pascal ComponentInstance SGGetVideoDigitizerComponent (SGChannel c)  = {0x2F3C,0,0x107,0x7000,0xA82A};
  415. pascal ComponentResult SGSetVideoDigitizerComponent (SGChannel c, ComponentInstance vdig)  = {0x2F3C,0x4,0x108,0x7000,0xA82A};
  416. pascal ComponentResult SGVideoDigitizerChanged (SGChannel c)  = {0x2F3C,0,0x109,0x7000,0xA82A};
  417.  
  418. pascal ComponentResult SGSetVideoBottlenecks (SGChannel c, VideoBottles *vb)  = {0x2F3C,0x4,0x10A,0x7000,0xA82A};
  419. pascal ComponentResult SGGetVideoBottlenecks (SGChannel c, VideoBottles *vb)  = {0x2F3C,0x4,0x10B,0x7000,0xA82A};
  420.  
  421. pascal ComponentResult SGGrabFrame (SGChannel c, short bufferNum)  = {0x2F3C,0x2,0x10C,0x7000,0xA82A};
  422. pascal ComponentResult SGGrabFrameComplete (SGChannel c, short bufferNum, Boolean *done)  = {0x2F3C,0x6,0x10D,0x7000,0xA82A};
  423. pascal ComponentResult SGDisplayFrame (SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn)  = {0x2F3C,0xA,0x10E,0x7000,0xA82A};
  424.  
  425. pascal ComponentResult SGCompressFrame (SGChannel c, short bufferNum)  = {0x2F3C,0x2,0x10F,0x7000,0xA82A};
  426. pascal ComponentResult SGCompressFrameComplete (SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci)  = {0x2F3C,0xA,0x110,0x7000,0xA82A};
  427.  
  428. pascal ComponentResult SGAddFrame (SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci)  = {0x2F3C,0xE,0x111,0x7000,0xA82A};
  429.  
  430. pascal ComponentResult SGTransferFrameForCompress (SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn)  = {0x2F3C,0xA,0x112,0x7000,0xA82A};
  431.  
  432. pascal ComponentResult SGSetCompressBuffer (SGChannel c, short depth, const Rect *compressSize)  = {0x2F3C,0x6,0x113,0x7000,0xA82A};
  433.  
  434. pascal ComponentResult SGGetCompressBuffer (SGChannel c, short *depth, Rect *compressSize)  = {0x2F3C,0x8,0x114,0x7000,0xA82A};
  435.  
  436. pascal ComponentResult SGGetBufferInfo (SGChannel c, short bufferNum, 
  437.                     PixMapHandle *bufferPM, Rect *bufferRect,
  438.                     GWorldPtr *compressBuffer, Rect *compressBufferRect)  = {0x2F3C,0x12,0x115,0x7000,0xA82A};
  439.  
  440. pascal ComponentResult SGSetUseScreenBuffer (SGChannel c, Boolean useScreenBuffer)  = {0x2F3C,0x2,0x116,0x7000,0xA82A};
  441.  
  442. pascal ComponentResult SGGetUseScreenBuffer (SGChannel c, Boolean *useScreenBuffer)  = {0x2F3C,0x4,0x117,0x7000,0xA82A};
  443.  
  444. pascal ComponentResult SGGrabCompressComplete (SGChannel c, Boolean *done, SGCompressInfo *ci, TimeRecord *tr)  = {0x2F3C,0xC,0x118,0x7000,0xA82A};
  445. pascal ComponentResult SGDisplayCompress (SGChannel c, Ptr dataPtr, ImageDescriptionHandle desc, MatrixRecord *mp, RgnHandle clipRgn)  = {0x2F3C,0x10,0x119,0x7000,0xA82A};
  446.  
  447. pascal ComponentResult SGSetFrameRate (SGChannel c, Fixed frameRate)  = {0x2F3C,0x4,0x11A,0x7000,0xA82A};
  448.  
  449. pascal ComponentResult SGGetFrameRate (SGChannel c, Fixed *frameRate)  = {0x2F3C,0x4,0x11B,0x7000,0xA82A};
  450. #ifdef __cplusplus
  451. }
  452. #endif __cplusplus
  453.  
  454.  
  455. /*** Sequence Grab SOUND CHANNEL Component Stuff ***/
  456.  
  457.  
  458. /*
  459.     Sound stuff
  460. */
  461.  
  462. #ifdef __cplusplus
  463. extern "C" {
  464. #endif __cplusplus
  465.  
  466. pascal ComponentResult SGSetSoundInputDriver (SGChannel c, const Str255 driverName)  = {0x2F3C,0x4,0x100,0x7000,0xA82A};
  467. pascal long SGGetSoundInputDriver (SGChannel c)  = {0x2F3C,0,0x101,0x7000,0xA82A};
  468. pascal ComponentResult SGSoundInputDriverChanged (SGChannel c)  = {0x2F3C,0,0x102,0x7000,0xA82A};
  469.  
  470. pascal ComponentResult SGSetSoundRecordChunkSize (SGChannel c, long seconds)  = {0x2F3C,0x4,0x103,0x7000,0xA82A};
  471. pascal long SGGetSoundRecordChunkSize (SGChannel c)  = {0x2F3C,0,0x104,0x7000,0xA82A};
  472.  
  473. pascal ComponentResult SGSetSoundInputRate (SGChannel c, Fixed rate)  = {0x2F3C,0x4,0x105,0x7000,0xA82A};
  474. pascal Fixed SGGetSoundInputRate (SGChannel c)  = {0x2F3C,0,0x106,0x7000,0xA82A};
  475.  
  476. pascal ComponentResult SGSetSoundInputParameters (SGChannel c, short sampleSize, short numChannels,
  477.                         OSType compressionType)  = {0x2F3C,0x8,0x107,0x7000,0xA82A};
  478. pascal ComponentResult SGGetSoundInputParameters (SGChannel c, short *sampleSize, short *numChannels,
  479.                         OSType *compressionType)  = {0x2F3C,0xC,0x108,0x7000,0xA82A};
  480. #ifdef __cplusplus
  481. }
  482. #endif __cplusplus
  483.  
  484.  
  485. #define sgChannelAtom 'chan'
  486.  
  487. #define sgChannelSettingsAtom 'ctom'
  488. #define sgChannelDescription 'cdsc'
  489. #define sgChannelSettings 'cset'
  490.  
  491. #define sgDeviceNameType 'name'
  492. #define sgUsageType 'use '
  493. #define sgPlayFlagsType 'plyf'
  494. #define sgClipType 'clip'
  495. #define sgMatrixType 'mtrx'
  496. #define sgVolumeType 'volu'
  497.  
  498. #define sgPanelSettingsAtom 'ptom'
  499. #define sgPanelDescription 'pdsc'
  500. #define sgPanelSettings 'pset'
  501.  
  502. #define sgcSoundCompressionType 'scmp'
  503. #define sgcSoundSampleRateType 'srat'
  504. #define sgcSoundChannelCountType 'schn'
  505. #define sgcSoundSampleSizeType 'ssiz'
  506. #define sgcSoundInputType 'sinp'
  507. #define sgcSoundGainType 'gain'
  508.  
  509. #define sgcVideoHueType 'hue '
  510. #define sgcVideoSaturationType 'satr'
  511. #define sgcVideoContrastType 'trst'
  512. #define sgcVideoSharpnessType 'shrp'
  513. #define sgcVideoBrigtnessType 'brit'
  514. #define sgcVideoBlackLevelType 'blkl'
  515. #define sgcVideoWhiteLevelType 'whtl'
  516.  
  517. #define sgcVideoInputType 'vinp'
  518. #define sgcVideoFormatType 'vstd'
  519. #define sgcVideoFilterType 'vflt'
  520.  
  521. #define sgcVideoRectType 'vrct'
  522. #define sgVideoDigitizerType 'vdig'
  523.  
  524. enum {
  525.     noDeviceForChannel = -9400,
  526.     grabTimeComplete = -9401,
  527.     cantDoThatInCurrentMode = -9402,
  528.     notEnoughMemoryToGrab = -9403,
  529.     notEnoughDiskSpaceToGrab = -9404,
  530.     couldntGetRequiredComponent = -9405,
  531.     badSGChannel = -9406,
  532.     seqGrabInfoNotAvailable = -9407,
  533.     deviceCantMeetRequest = -9408
  534. };
  535.  
  536.  
  537. enum {
  538.     kSGInitializeSelect = 0x1,
  539.     kSGSetDataOutputSelect = 0x2,
  540.     kSGGetDataOutputSelect = 0x3,
  541.     kSGSetGWorldSelect = 0x4,
  542.     kSGGetGWorldSelect = 0x5,
  543.     kSGNewChannelSelect = 0x6,
  544.     kSGDisposeChannelSelect = 0x7,
  545.     kSGStartPreviewSelect = 0x10,
  546.     kSGStartRecordSelect = 0x11,
  547.     kSGIdleSelect = 0x12,
  548.     kSGStopSelect = 0x13,
  549.     kSGPauseSelect = 0x14,
  550.     kSGPrepareSelect = 0x15,
  551.     kSGReleaseSelect = 0x16,
  552.     kSGGetMovieSelect = 0x17,
  553.     kSGSetMaximumRecordTimeSelect = 0x18,
  554.     kSGGetMaximumRecordTimeSelect = 0x19,
  555.     kSGGetStorageSpaceRemainingSelect = 0x1A,
  556.     kSGGetTimeRemainingSelect = 0x1B,
  557.     kSGGrabPictSelect = 0x1C,
  558.     kSGGetLastMovieResIDSelect = 0x1D,
  559.     kSGSetFlagsSelect = 0x1E,
  560.     kSGGetFlagsSelect = 0x1F,
  561.     kSGSetDataProcSelect = 0x20,
  562.     kSGNewChannelFromComponentSelect = 0x21,
  563.     kSGDisposeDeviceListSelect = 0x22,
  564.     kSGAppendDeviceListToMenuSelect = 0x23,
  565.     kSGSetSettingsSelect = 0x24,
  566.     kSGGetSettingsSelect = 0x25,
  567.     kSGGetIndChannelSelect = 0x26,
  568.     kSGUpdateSelect = 0x27,
  569.     kSGGetPauseSelect = 0x28,
  570.     kSGSettingsDialogSelect = 0x29,
  571.     kSGGetAlignmentProcSelect = 0x2A,
  572.     kSGSetChannelSettingsSelect = 0x2B,
  573.     kSGGetChannelSettingsSelect = 0x2C,
  574.     kSGWriteMovieDataSelect = 0x100,
  575.     kSGAddFrameReferenceSelect = 0x101,
  576.     kSGGetNextFrameReferenceSelect = 0x102,
  577.     kSGGetTimeBaseSelect = 0x103,
  578.     kSGSortDeviceListSelect = 0x104,
  579.     kSGAddMovieDataSelect = 0x105,
  580.     kSGChangedSourceSelect = 0x106,
  581.     kSGCSetChannelUsageSelect = 0x80,
  582.     kSGCGetChannelUsageSelect = 0x81,
  583.     kSGCSetChannelBoundsSelect = 0x82,
  584.     kSGCGetChannelBoundsSelect = 0x83,
  585.     kSGCSetChannelVolumeSelect = 0x84,
  586.     kSGCGetChannelVolumeSelect = 0x85,
  587.     kSGCGetChannelInfoSelect = 0x86,
  588.     kSGCSetChannelPlayFlagsSelect = 0x87,
  589.     kSGCGetChannelPlayFlagsSelect = 0x88,
  590.     kSGCSetChannelMaxFramesSelect = 0x89,
  591.     kSGCGetChannelMaxFramesSelect = 0x8A,
  592.     kSGCSetChannelRefConSelect = 0x8B,
  593.     kSGCSetChannelClipSelect = 0x8C,
  594.     kSGCGetChannelClipSelect = 0x8D,
  595.     kSGCGetChannelSampleDescriptionSelect = 0x8E,
  596.     kSGCGetChannelDeviceListSelect = 0x8F,
  597.     kSGCSetChannelDeviceSelect = 0x90,
  598.     kSGCSetChannelMatrixSelect = 0x91,
  599.     kSGCGetChannelMatrixSelect = 0x92,
  600.     kSGCGetChannelTimeScaleSelect = 0x93,
  601.     kSGCInitChannelSelect = 0x180,
  602.     kSGCWriteSamplesSelect = 0x181,
  603.     kSGCGetDataRateSelect = 0x182,
  604.     kSGCAlignChannelRectSelect = 0x183,
  605.     kSGCPanelGetDitlSelect = 0x200,
  606.     kSGCPanelGetTitleSelect = 0x201,
  607.     kSGCPanelCanRunSelect = 0x202,
  608.     kSGCPanelInstallSelect = 0x203,
  609.     kSGCPanelEventSelect = 0x204,
  610.     kSGCPanelItemSelect = 0x205,
  611.     kSGCPanelRemoveSelect = 0x206,
  612.     kSGCPanelSetGrabberSelect = 0x207,
  613.     kSGCPanelSetResFileSelect = 0x208,
  614.     kSGCPanelGetSettingsSelect = 0x209,
  615.     kSGCPanelSetSettingsSelect = 0x20A,
  616.     kSGCPanelValidateInputSelect = 0x20B,
  617.     kSGCGetSrcVideoBoundsSelect = 0x100,
  618.     kSGCSetVideoRectSelect = 0x101,
  619.     kSGCGetVideoRectSelect = 0x102,
  620.     kSGCGetVideoCompressorTypeSelect = 0x103,
  621.     kSGCSetVideoCompressorTypeSelect = 0x104,
  622.     kSGCSetVideoCompressorSelect = 0x105,
  623.     kSGCGetVideoCompressorSelect = 0x106,
  624.     kSGCGetVideoDigitizerComponentSelect = 0x107,
  625.     kSGCSetVideoDigitizerComponentSelect = 0x108,
  626.     kSGCVideoDigitizerChangedSelect = 0x109,
  627.     kSGCSetVideoBottlenecksSelect = 0x10A,
  628.     kSGCGetVideoBottlenecksSelect = 0x10B,
  629.     kSGCGrabFrameSelect = 0x10C,
  630.     kSGCGrabFrameCompleteSelect = 0x10D,
  631.     kSGCDisplayFrameSelect = 0x10E,
  632.     kSGCCompressFrameSelect = 0x10F,
  633.     kSGCCompressFrameCompleteSelect = 0x110,
  634.     kSGCAddFrameSelect = 0x111,
  635.     kSGCTransferFrameForCompressSelect = 0x112,
  636.     kSGCSetCompressBufferSelect = 0x113,
  637.     kSGCGetCompressBufferSelect = 0x114,
  638.     kSGCGetBufferInfoSelect = 0x115,
  639.     kSGCSetUseScreenBufferSelect = 0x116,
  640.     kSGCGetUseScreenBufferSelect = 0x117,
  641.     kSGCGrabCompressCompleteSelect = 0x118,
  642.     kSGCDisplayCompressSelect = 0x119,
  643.     kSGCSetFrameRateSelect = 0x11A,
  644.     kSGCGetFrameRateSelect = 0x11B,
  645.     kSGCSetSoundInputDriverSelect = 0x100,
  646.     kSGCGetSoundInputDriverSelect = 0x101,
  647.     kSGCSoundInputDriverChangedSelect = 0x102,
  648.     kSGCSetSoundRecordChunkSizeSelect = 0x103,
  649.     kSGCGetSoundRecordChunkSizeSelect = 0x104,
  650.     kSGCSetSoundInputRateSelect = 0x105,
  651.     kSGCGetSoundInputRateSelect = 0x106,
  652.     kSGCSetSoundInputParametersSelect = 0x107,
  653.     kSGCGetSoundInputParametersSelect = 0x108 
  654. };
  655.  
  656. /* Standard type for video digitizers */
  657.  
  658. #define    videoDigitizerComponentType        'vdig'        
  659. #define vdigInterfaceRev                2L
  660.  
  661. /* Input Format Standards */
  662.  
  663. #define    ntscIn            0                /* current input format */
  664. #define    currentIn        0                /* ntsc input format */
  665. #define    palIn            1                /* pal input format */
  666. #define    secamIn            2                /* secam input format */
  667. #define    ntscReallyIn    3                /* ntsc input format */
  668.  
  669. /* Input Formats */
  670.  
  671. #define    compositeIn        0                /* input is composite format */
  672. #define    sVideoIn        1                /* input is sVideo format */
  673. #define rgbComponentIn    2                /* input is rgb component format */
  674.  
  675. /* Video Digitizer PlayThru States */
  676.  
  677. #define vdPlayThruOff        0
  678. #define vdPlayThruOn        1
  679.  
  680. /* Input Color Space Modes */
  681.  
  682. #define vdDigitizerBW        0            /* black and white */
  683. #define vdDigitizerRGB        1            /* rgb color */
  684.  
  685. /* Phase Lock Loop Modes */
  686.  
  687. #define vdBroadcastMode        0            /* Broadcast / Laser Disk video mode */
  688. #define vdVTRMode            1            /* VCR / Magnetic media mode */
  689.  
  690. /* Field Select Options */
  691. #define vdUseAnyField 0                    /* Digitizers choice on field use */
  692. #define vdUseOddField 1                    /* Use odd field for half size vert and smaller */
  693. #define vdUseEvenField 2                /* Use even field for half size vert and smaller */
  694.  
  695. /* vdig types */
  696.  
  697. #define vdTypeBasic            0            /* basic, no clipping */
  698. #define vdTypeAlpha            1            /* supports clipping with alpha channel */
  699. #define vdTypeMask            2            /* supports clipping with mask plane */
  700. #define vdTypeKey            3            /* supports clipping with key color(s) */
  701.  
  702. /* Digitizer Error Codes */
  703.  
  704. #define    digiUnimpErr    -2201             /* feature unimplemented */
  705. #define    qtParamErr        -2202            /* bad input parameter (out of range, etc) */
  706. #define    matrixErr        -2203            /* bad matrix, digitizer did nothing */
  707. #define    notExactMatrix    -2204            /* warning of bad matrix, digitizer did its best */
  708. #define    noMoreKeyColors    -2205            /* all key indexes in use */
  709. #define    notExactSize    -2206            /* Can’t do exact size requested */
  710. #define    badDepth        -2207            /* Can’t digitize into this depth */
  711. #define    noDMA            -2208            /* Can’t do DMA digitizing (i.e. can't go to requested dest */
  712. #define badCallOrder    -2209            /* Usually due to a status call being called prior to being setup first */
  713.  
  714. /* Digitizer Input Capability/Current Flags    */
  715.  
  716. #define    digiInDoesNTSC        (1L<<0)        /* digitizer supports NTSC input format */
  717. #define    digiInDoesPAL        (1L<<1)        /* digitizer supports PAL input format */
  718. #define    digiInDoesSECAM        (1L<<2)        /* digitizer supports SECAM input format */
  719. #define digiInDoesGenLock    (1L<<7)        /* digitizer does genlock */
  720.  
  721. #define    digiInDoesComposite    (1L<<8)        /* digitizer supports composite input type */
  722. #define    digiInDoesSVideo    (1L<<9)        /* digitizer supports S-Video input type */
  723. #define digiInDoesComponent (1L<<10)    /* digitizer supports component (rgb) input type */
  724. #define    digiInVTR_Broadcast    (1L<<11)    /* digitizer can differentiate between the two */
  725.  
  726. #define    digiInDoesColor        (1L<<12)    /* digitizer supports color */
  727. #define    digiInDoesBW        (1L<<13)    /* digitizer supports black & white */
  728.  
  729. /* Digitizer Input Current Flags (these are valid only during active operating conditions)    */
  730.  
  731. #define    digiInSignalLock    (1L<<31)    /* digitizer detects input signal is locked */
  732.                                         /* this bit = horiz lock || vertical lock */
  733.  
  734. /* Digitizer Output Capability/Current Flags */
  735.  
  736. #define    digiOutDoes1            (1L<<0)        /* digitizer supports 1 bit pixels */
  737. #define    digiOutDoes2            (1L<<1)        /* digitizer supports 2 bit pixels */
  738. #define    digiOutDoes4            (1L<<2)        /* digitizer supports 4 bit pixels */
  739. #define    digiOutDoes8            (1L<<3)        /* digitizer supports 8 bit pixels */
  740. #define    digiOutDoes16            (1L<<4)        /* digitizer supports 16 bit pixels */
  741. #define    digiOutDoes32            (1L<<5)        /* digitizer supports 32 bit pixels */
  742. #define    digiOutDoesDither        (1L<<6)        /* digitizer dithers in indexed modes */
  743. #define    digiOutDoesStretch        (1L<<7)        /* digitizer can arbitrarily stretch */
  744. #define    digiOutDoesShrink        (1L<<8)        /* digitizer can arbitrarily shrink */
  745. #define    digiOutDoesMask            (1L<<9)        /* digitizer can mask to clipping regions */
  746.  
  747. #define    digiOutDoesDouble        (1L<<11)    /* digitizer can stretch to exactly double size */
  748. #define    digiOutDoesQuad            (1L<<12)    /* digitizer can stretch exactly quadruple size */
  749. #define    digiOutDoesQuarter        (1L<<13)    /* digitizer can shrink to exactly quarter size */
  750. #define    digiOutDoesSixteenth    (1L<<14)    /* digitizer can shrink to exactly sixteenth size */
  751.  
  752. #define    digiOutDoesRotate        (1L<<15)    /* digitizer supports rotate transformations */
  753. #define    digiOutDoesHorizFlip    (1L<<16)    /* digitizer supports horizontal flips Sx < 0 */
  754. #define    digiOutDoesVertFlip        (1L<<17)    /* digitizer supports vertical flips Sy < 0 */
  755. #define    digiOutDoesSkew            (1L<<18)    /* digitizer supports skew (shear,twist) */
  756. #define    digiOutDoesBlend        (1L<<19)
  757. #define    digiOutDoesWarp            (1L<<20)
  758.  
  759. #define    digiOutDoesHW_DMA        (1L<<21)    /* digitizer not constrained to local device */
  760. #define digiOutDoesHWPlayThru    (1L<<22)    /* digitizer doesn't need time to play thru */
  761. #define    digiOutDoesILUT            (1L<<23)    /* digitizer does inverse LUT for index modes */
  762. #define    digiOutDoesKeyColor        (1L<<24)    /* digitizer does key color functions too */
  763. #define digiOutDoesAsyncGrabs    (1L<<25)    /* digitizer supports async grabs */
  764. #define digiOutDoesUnreadableScreenBits (1L<<26)    /* playthru doesn't generate readable bits on screen*/
  765. #define digiOutDoesCompress        (1L<<27)    /* supports alternate output data types */
  766. #define digiOutDoesCompressOnly    (1L<<28)    /* can't provide raw frames anywhere */
  767. #define digiOutDoesPlayThruDuringCompress (1L<<29)    /* digi can do playthru while providing compressed data */
  768.  
  769. /* Types */
  770.  
  771. typedef ComponentInstance VideoDigitizerComponent;
  772. typedef ComponentResult VideoDigitizerError;
  773.  
  774. typedef struct {
  775.     short        vdigType;
  776.     long         inputCapabilityFlags;
  777.     long         outputCapabilityFlags;    
  778.     long         inputCurrentFlags;
  779.     long         outputCurrentFlags;
  780.     short        slot;                    /* temporary for connection purposes */
  781.     GDHandle    gdh;                    /* temporary for digitizers that have preferred screen */
  782.     GDHandle    maskgdh;                /* temporary for digitizers that have mask planes */
  783.     short        minDestHeight;            /* Smallest resizable height */        
  784.     short        minDestWidth;            /* Smallest resizable width */
  785.     short        maxDestHeight;            /* Largest resizable height */
  786.     short        maxDestWidth;            /* Largest resizable height */
  787.     short        blendLevels;            /* Number of blend levels supported (2 if 1 bit mask) */
  788.     long        reserved;                /* reserved */
  789. } DigitizerInfo;
  790.  
  791. typedef struct {
  792.     long        type;
  793.     long        reserved;
  794. } VdigType;
  795.  
  796. typedef struct {
  797.     short        count;
  798.     VdigType    list[1];
  799. } VdigTypeList;
  800.  
  801. typedef struct {
  802.     PixMapHandle    dest;
  803.     Point            location;
  804.     long            reserved;
  805. } VdigBufferRec;
  806.  
  807. typedef struct {
  808.     short            count;
  809.     MatrixRecordPtr    matrix;
  810.     RgnHandle        mask;
  811.     VdigBufferRec    list[1];
  812. } VdigBufferRecList;
  813.  
  814. typedef VdigBufferRecList *VdigBufferRecListPtr, **VdigBufferRecListHandle;
  815.  
  816. typedef pascal void (*VdigIntProc)(long flags, long refcon);
  817.  
  818. typedef struct VDCompressionList {
  819.     CodecComponent        codec;
  820.     CodecType            cType;
  821.     Str63                typeName;
  822.     Str63                name;
  823.     long                formatFlags;
  824.     long                compressFlags;
  825.     long                reserved;
  826. } VDCompressionList, *VDCompressionListPtr, **VDCompressionListHandle;
  827.  
  828. enum {
  829.     dmaDepth1 = 1,
  830.     dmaDepth2 = 2,
  831.     dmaDepth4 = 4 ,
  832.     dmaDepth8 = 8,
  833.     dmaDepth16 = 16,
  834.     dmaDepth32 = 32,
  835.     dmaDepth2Gray = 64,
  836.     dmaDepth4Gray = 128,
  837.     dmaDepth8Gray = 256
  838. };
  839.  
  840.  
  841.  
  842. // number of vdig calls
  843. enum {
  844.     kvdigSelectors = 82
  845. };
  846.  
  847. #ifdef __cplusplus
  848. extern "C" {
  849. #endif __cplusplus
  850. pascal VideoDigitizerError VDGetMaxSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *maxSrcRect)     = {0x2F3C,0x6,0x1,0x7000,0xA82A};
  851.     
  852. pascal VideoDigitizerError VDGetActiveSrcRect(VideoDigitizerComponent ci, short inputStd, Rect *activeSrcRect)     = {0x2F3C,0x6,0x2,0x7000,0xA82A};
  853.     
  854. pascal VideoDigitizerError VDSetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)     = {0x2F3C,0x4,0x3,0x7000,0xA82A};
  855.     
  856. pascal VideoDigitizerError VDGetDigitizerRect(VideoDigitizerComponent ci, Rect *digitizerRect)     = {0x2F3C,0x4,0x4,0x7000,0xA82A};
  857.     
  858. pascal VideoDigitizerError VDGetVBlankRect(VideoDigitizerComponent ci, short inputStd, Rect *vBlankRect)     = {0x2F3C,0x6,0x5,0x7000,0xA82A};
  859.     
  860. pascal VideoDigitizerError VDGetMaskPixMap(VideoDigitizerComponent ci, PixMapHandle maskPixMap)     = {0x2F3C,0x4,0x6,0x7000,0xA82A};
  861.     
  862. pascal VideoDigitizerError VDGetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle *dest, Rect *destRect,
  863.              MatrixRecord *m, RgnHandle *mask)     = {0x2F3C,0x10,0x8,0x7000,0xA82A};
  864.     
  865. pascal VideoDigitizerError VDUseThisCLUT(VideoDigitizerComponent ci, CTabHandle colorTableHandle)     = {0x2F3C,0x4,0x9,0x7000,0xA82A};        
  866.     
  867. pascal VideoDigitizerError VDSetInputGammaValue(VideoDigitizerComponent ci, Fixed channel1, Fixed channel2, Fixed channel3)     = {0x2F3C,0xC,0xA,0x7000,0xA82A};
  868.     
  869. pascal VideoDigitizerError VDGetInputGammaValue(VideoDigitizerComponent ci, Fixed *channel1, Fixed *channel2, Fixed *channel3)     = {0x2F3C,0xC,0xB,0x7000,0xA82A};
  870.     
  871. pascal VideoDigitizerError VDSetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)     = {0x2F3C,0x4,0xC,0x7000,0xA82A};
  872.     
  873. pascal VideoDigitizerError VDGetBrightness(VideoDigitizerComponent ci, unsigned short *brightness)     = {0x2F3C,0x4,0xD,0x7000,0xA82A};
  874.     
  875. pascal VideoDigitizerError VDSetContrast(VideoDigitizerComponent ci, unsigned short *contrast)     = {0x2F3C,0x4,0xE,0x7000,0xA82A};
  876.     
  877. pascal VideoDigitizerError VDSetHue(VideoDigitizerComponent ci, unsigned short *hue)     = {0x2F3C,0x4,0xF,0x7000,0xA82A};
  878.     
  879. pascal VideoDigitizerError VDSetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)     = {0x2F3C,0x4,0x10,0x7000,0xA82A};
  880.     
  881. pascal VideoDigitizerError VDSetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)     = {0x2F3C,0x4,0x11,0x7000,0xA82A};
  882.     
  883. pascal VideoDigitizerError VDGetContrast(VideoDigitizerComponent ci, unsigned short *contrast)     = {0x2F3C,0x4,0x12,0x7000,0xA82A};
  884.     
  885. pascal VideoDigitizerError VDGetHue(VideoDigitizerComponent ci, unsigned short *hue)     = {0x2F3C,0x4,0x13,0x7000,0xA82A};
  886.     
  887. pascal VideoDigitizerError VDGetSharpness(VideoDigitizerComponent ci, unsigned short *sharpness)     = {0x2F3C,0x4,0x14,0x7000,0xA82A};
  888.     
  889. pascal VideoDigitizerError VDGetSaturation(VideoDigitizerComponent ci, unsigned short *saturation)     = {0x2F3C,0x4,0x15,0x7000,0xA82A};
  890.     
  891. pascal VideoDigitizerError VDGrabOneFrame(VideoDigitizerComponent ci)     = {0x2F3C,0,0x16,0x7000,0xA82A};
  892.     
  893. pascal VideoDigitizerError VDGetMaxAuxBuffer(VideoDigitizerComponent ci, PixMapHandle *pm, Rect *r)     = {0x2F3C,0x8,0x17,0x7000,0xA82A};
  894.     
  895. pascal VideoDigitizerError VDGetDigitizerInfo(VideoDigitizerComponent ci, DigitizerInfo *info)     = {0x2F3C,0x4,0x19,0x7000,0xA82A};
  896.     
  897. pascal VideoDigitizerError VDGetCurrentFlags(VideoDigitizerComponent ci, long *inputCurrentFlag, long *outputCurrentFlag)     = {0x2F3C,0x8,0x1A,0x7000,0xA82A};
  898.     
  899. pascal VideoDigitizerError VDSetKeyColor(VideoDigitizerComponent ci, long index)     = {0x2F3C,0x4,0x1B,0x7000,0xA82A};
  900.     
  901. pascal VideoDigitizerError VDGetKeyColor(VideoDigitizerComponent ci, long *index)     = {0x2F3C,0x4,0x1C,0x7000,0xA82A};
  902.     
  903. pascal VideoDigitizerError VDAddKeyColor(VideoDigitizerComponent ci, long *index)     = {0x2F3C,0x4,0x1D,0x7000,0xA82A};
  904.     
  905. pascal VideoDigitizerError VDGetNextKeyColor(VideoDigitizerComponent ci, long index)     = {0x2F3C,0x4,0x1E,0x7000,0xA82A};
  906.     
  907. pascal VideoDigitizerError VDSetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)     = {0x2F3C,0x8,0x1F,0x7000,0xA82A};
  908.     
  909. pascal VideoDigitizerError VDGetKeyColorRange(VideoDigitizerComponent ci, RGBColor *minRGB, RGBColor *maxRGB)     = {0x2F3C,0x8,0x20,0x7000,0xA82A};
  910.     
  911. pascal VideoDigitizerError VDSetDigitizerUserInterrupt(VideoDigitizerComponent ci, long flags, VdigIntProc userInterruptProc, long refcon)     = {0x2F3C,0xC,0x21,0x7000,0xA82A};
  912.     
  913. pascal VideoDigitizerError VDSetInputColorSpaceMode(VideoDigitizerComponent ci, short colorSpaceMode)     = {0x2F3C,0x2,0x22,0x7000,0xA82A};
  914.     
  915. pascal VideoDigitizerError VDGetInputColorSpaceMode(VideoDigitizerComponent ci, short *colorSpaceMode)     = {0x2F3C,0x4,0x23,0x7000,0xA82A};
  916.     
  917. pascal VideoDigitizerError VDSetClipState(VideoDigitizerComponent ci, short clipEnable)     = {0x2F3C,0x2,0x24,0x7000,0xA82A};
  918.     
  919. pascal VideoDigitizerError VDGetClipState(VideoDigitizerComponent ci, short *clipEnable)     = {0x2F3C,0x4,0x25,0x7000,0xA82A};
  920.     
  921. pascal VideoDigitizerError VDSetClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)     = {0x2F3C,0x4,0x26,0x7000,0xA82A};
  922.     
  923. pascal VideoDigitizerError VDClearClipRgn(VideoDigitizerComponent ci, RgnHandle clipRegion)     = {0x2F3C,0x4,0x27,0x7000,0xA82A};
  924.     
  925. pascal VideoDigitizerError VDGetCLUTInUse(VideoDigitizerComponent ci, CTabHandle *colorTableHandle)     = {0x2F3C,0x4,0x28,0x7000,0xA82A};        
  926.     
  927. pascal VideoDigitizerError VDSetPLLFilterType(VideoDigitizerComponent ci, short pllType)     = {0x2F3C,0x2,0x29,0x7000,0xA82A};
  928.     
  929. pascal VideoDigitizerError VDGetPLLFilterType(VideoDigitizerComponent ci, short *pllType)     = {0x2F3C,0x4,0x2A,0x7000,0xA82A};
  930.     
  931. pascal VideoDigitizerError VDGetMaskandValue(VideoDigitizerComponent ci, unsigned short blendLevel, long *mask, long *value )     = {0x2F3C,0xA,0x2B,0x7000,0xA82A};
  932.     
  933. pascal VideoDigitizerError VDSetMasterBlendLevel(VideoDigitizerComponent ci, unsigned short *blendLevel)     = {0x2F3C,0x4,0x2C,0x7000,0xA82A};
  934.     
  935. pascal VideoDigitizerError VDSetPlayThruDestination(VideoDigitizerComponent ci, PixMapHandle dest, Rect *destRect,
  936.                                 MatrixRecord *m, RgnHandle mask)     = {0x2F3C,0x10,0x2D,0x7000,0xA82A};
  937.     
  938. pascal VideoDigitizerError VDSetPlayThruOnOff(VideoDigitizerComponent ci, short state)     = {0x2F3C,0x2,0x2E,0x7000,0xA82A};
  939.  
  940. pascal VideoDigitizerError VDSetFieldPreference(VideoDigitizerComponent ci, short fieldFlag)     = {0x2F3C,0x2,0x2F,0x7000,0xA82A};
  941.  
  942. pascal VideoDigitizerError VDGetFieldPreference(VideoDigitizerComponent ci, short *fieldFlag)     = {0x2F3C,0x4,0x30,0x7000,0xA82A};
  943.     
  944. pascal VideoDigitizerError VDPreflightDestination(VideoDigitizerComponent ci, Rect *digitizerRect, PixMap **dest, 
  945.                                 Rect *destRect, MatrixRecord *m)     = {0x2F3C,0x10,0x32,0x7000,0xA82A};
  946.     
  947. pascal VideoDigitizerError VDPreflightGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)     = {0x2F3C,0x8,0x33,0x7000,0xA82A};
  948.     
  949. pascal VideoDigitizerError VDSetPlayThruGlobalRect(VideoDigitizerComponent ci, GrafPtr theWindow, Rect *globalRect)     = {0x2F3C,0x8,0x34,0x7000,0xA82A};
  950.     
  951. pascal VideoDigitizerError VDSetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr inputGammaPtr)     = {0x2F3C,0x4,0x35,0x7000,0xA82A};
  952.     
  953. pascal VideoDigitizerError VDGetInputGammaRecord(VideoDigitizerComponent ci, VDGamRecPtr *inputGammaPtr)     = {0x2F3C,0x4,0x36,0x7000,0xA82A};
  954.     
  955. pascal VideoDigitizerError VDSetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)     = {0x2F3C,0x4,0x37,0x7000,0xA82A};
  956.     
  957. pascal VideoDigitizerError VDGetBlackLevelValue(VideoDigitizerComponent ci, unsigned short *blackLevel)     = {0x2F3C,0x4,0x38,0x7000,0xA82A};
  958.     
  959. pascal VideoDigitizerError VDSetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)     = {0x2F3C,0x4,0x39,0x7000,0xA82A};
  960.     
  961. pascal VideoDigitizerError VDGetWhiteLevelValue(VideoDigitizerComponent ci, unsigned short *whiteLevel)     = {0x2F3C,0x4,0x3A,0x7000,0xA82A};
  962.     
  963. pascal VideoDigitizerError VDGetVideoDefaults(VideoDigitizerComponent ci, 
  964.         unsigned short *blackLevel, unsigned short *whiteLevel,
  965.         unsigned short *brightness, unsigned short *hue, unsigned short *saturation,
  966.         unsigned short *contrast, unsigned short *sharpness)     = {0x2F3C,0x1C,0x3B,0x7000,0xA82A};
  967.     
  968. pascal VideoDigitizerError VDGetNumberOfInputs(VideoDigitizerComponent ci, short *inputs)     = {0x2F3C,0x4,0x3C,0x7000,0xA82A};
  969.     
  970. pascal VideoDigitizerError VDGetInputFormat(VideoDigitizerComponent ci, short input, short *format)     = {0x2F3C,0x6,0x3D,0x7000,0xA82A};
  971.     
  972. pascal VideoDigitizerError VDSetInput(VideoDigitizerComponent ci, short input)     = {0x2F3C,0x2,0x3E,0x7000,0xA82A};
  973.     
  974. pascal VideoDigitizerError VDGetInput(VideoDigitizerComponent ci, short *input)     = {0x2F3C,0x4,0x3F,0x7000,0xA82A};
  975.     
  976. pascal VideoDigitizerError VDSetInputStandard(VideoDigitizerComponent ci, short inputStandard)     = {0x2F3C,0x2,0x40,0x7000,0xA82A};
  977.     
  978. pascal VideoDigitizerError VDSetupBuffers(VideoDigitizerComponent ci, VdigBufferRecListHandle bufferList)     = {0x2F3C,0x4,0x41,0x7000,0xA82A};
  979.     
  980. pascal VideoDigitizerError VDGrabOneFrameAsync(VideoDigitizerComponent ci, short buffer)     = {0x2F3C,0x2,0x42,0x7000,0xA82A};
  981.     
  982. pascal VideoDigitizerError VDDone(VideoDigitizerComponent ci, short buffer)     = {0x2F3C,0x2,0x43,0x7000,0xA82A};
  983.  
  984. pascal VideoDigitizerError VDSetCompression(VideoDigitizerComponent ci, OSType compressType, short depth, Rect *bounds,
  985.             CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate)     = {0x2F3C,0x16,0x44,0x7000,0xA82A};
  986.  
  987. pascal VideoDigitizerError VDCompressOneFrameAsync(VideoDigitizerComponent ci )     = {0x2F3C,0,0x45,0x7000,0xA82A};
  988.  
  989. pascal VideoDigitizerError VDCompressDone(VideoDigitizerComponent ci, Boolean *done, Ptr *theData, long *dataSize, unsigned char *similarity, TimeRecord *t)     = {0x2F3C,0x14,0x46,0x7000,0xA82A};
  990.  
  991. pascal VideoDigitizerError VDReleaseCompressBuffer(VideoDigitizerComponent ci, Ptr bufferAddr)     = {0x2F3C,0x4,0x47,0x7000,0xA82A};
  992.  
  993. pascal VideoDigitizerError VDGetImageDescription(VideoDigitizerComponent ci, ImageDescriptionHandle desc)     = {0x2F3C,0x4,0x48,0x7000,0xA82A};
  994.  
  995. pascal VideoDigitizerError VDResetCompressSequence(VideoDigitizerComponent ci )     = {0x2F3C,0,0x49,0x7000,0xA82A};
  996.  
  997. pascal VideoDigitizerError VDSetCompressionOnOff(VideoDigitizerComponent ci, Boolean state)     = {0x2F3C,0x2,0x4A,0x7000,0xA82A};
  998.  
  999. pascal VideoDigitizerError VDGetCompressionTypes(VideoDigitizerComponent ci, VDCompressionListHandle h)     = {0x2F3C,0x4,0x4B,0x7000,0xA82A};
  1000.  
  1001. pascal VideoDigitizerError VDSetTimeBase(VideoDigitizerComponent ci, TimeBase t)     = {0x2F3C,0x4,0x4C,0x7000,0xA82A};
  1002.  
  1003. pascal VideoDigitizerError VDSetFrameRate(VideoDigitizerComponent ci, Fixed framesPerSecond)     = {0x2F3C,0x4,0x4D,0x7000,0xA82A};
  1004.  
  1005. pascal VideoDigitizerError VDGetDataRate(VideoDigitizerComponent ci, long *milliSecPerFrame, Fixed *framesPerSecond, long *bytesPerSecond)     = {0x2F3C,0xC,0x4E,0x7000,0xA82A};
  1006.  
  1007. pascal VideoDigitizerError VDGetSoundInputDriver(VideoDigitizerComponent ci, Str255 soundDriverName)     = {0x2F3C,0x4,0x4F,0x7000,0xA82A};
  1008.  
  1009. pascal VideoDigitizerError VDGetDMADepths(VideoDigitizerComponent ci, long *depthArray, long *preferredDepth)     = {0x2F3C,0x8,0x50,0x7000,0xA82A};
  1010.  
  1011. pascal VideoDigitizerError VDGetPreferredTimeScale(VideoDigitizerComponent ci, TimeScale *preferred)     = {0x2F3C,0x4,0x51,0x7000,0xA82A};
  1012.  
  1013. pascal VideoDigitizerError VDReleaseAsyncBuffers(VideoDigitizerComponent ci)     = {0x2F3C,0,0x52,0x7000,0xA82A};
  1014.  
  1015. #ifdef __cplusplus
  1016. }
  1017. #endif __cplusplus
  1018.  
  1019. enum {
  1020.     kSelectVDGetMaxSrcRect = 0x1,
  1021.     kSelectVDGetActiveSrcRect = 0x2,
  1022.     kSelectVDSetDigitizerRect = 0x3,
  1023.     kSelectVDGetDigitizerRect = 0x4,
  1024.     kSelectVDGetVBlankRect = 0x5,
  1025.     kSelectVDGetMaskPixMap = 0x6,
  1026.     kSelectVDGetPlayThruDestination = 0x8,
  1027.     kSelectVDUseThisCLUT = 0x9,        
  1028.     kSelectVDSetInputGammaValue = 0xA,
  1029.     kSelectVDGetInputGammaValue = 0xB,
  1030.     kSelectVDSetBrightness = 0xC,
  1031.     kSelectVDGetBrightness = 0xD,
  1032.     kSelectVDSetContrast = 0xE,
  1033.     kSelectVDSetHue = 0xF,
  1034.     kSelectVDSetSharpness = 0x10,
  1035.     kSelectVDSetSaturation = 0x11,
  1036.     kSelectVDGetContrast = 0x12,
  1037.     kSelectVDGetHue = 0x13,
  1038.     kSelectVDGetSharpness = 0x14,
  1039.     kSelectVDGetSaturation = 0x15,
  1040.     kSelectVDGrabOneFrame = 0x16,
  1041.     kSelectVDGetMaxAuxBuffer = 0x17,
  1042.     kSelectVDGetDigitizerInfo = 0x19,
  1043.     kSelectVDGetCurrentFlags = 0x1A,
  1044.     kSelectVDSetKeyColor = 0x1B,
  1045.     kSelectVDGetKeyColor = 0x1C,
  1046.     kSelectVDAddKeyColor = 0x1D,
  1047.     kSelectVDGetNextKeyColor = 0x1E,
  1048.     kSelectVDSetKeyColorRange = 0x1F,
  1049.     kSelectVDGetKeyColorRange = 0x20,
  1050.     kSelectVDSetDigitizerUserInterrupt = 0x21,
  1051.     kSelectVDSetInputColorSpaceMode = 0x22,
  1052.     kSelectVDGetInputColorSpaceMode = 0x23,
  1053.     kSelectVDSetClipState = 0x24,
  1054.     kSelectVDGetClipState = 0x25,
  1055.     kSelectVDSetClipRgn = 0x26,
  1056.     kSelectVDClearClipRgn = 0x27,
  1057.     kSelectVDGetCLUTInUse = 0x28,        
  1058.     kSelectVDSetPLLFilterType = 0x29,
  1059.     kSelectVDGetPLLFilterType = 0x2A,
  1060.     kSelectVDGetMaskandValue = 0x2B,
  1061.     kSelectVDSetMasterBlendLevel = 0x2C,
  1062.     kSelectVDSetPlayThruDestination = 0x2D,
  1063.     kSelectVDSetPlayThruOnOff = 0x2E,
  1064.     kSelectVDSetFieldPreference = 0x2F,
  1065.     kSelectVDGetFieldPreference = 0x30,
  1066.     kSelectVDPreflightDestination = 0x32,
  1067.     kSelectVDPreflightGlobalRect = 0x33,
  1068.     kSelectVDSetPlayThruGlobalRect = 0x34,
  1069.     kSelectVDSetInputGammaRecord = 0x35,
  1070.     kSelectVDGetInputGammaRecord = 0x36,
  1071.     kSelectVDSetBlackLevelValue = 0x37,
  1072.     kSelectVDGetBlackLevelValue = 0x38,
  1073.     kSelectVDSetWhiteLevelValue = 0x39,
  1074.     kSelectVDGetWhiteLevelValue = 0x3A,
  1075.     kSelectVDGetVideoDefaults = 0x3B,
  1076.     kSelectVDGetNumberOfInputs = 0x3C,
  1077.     kSelectVDGetInputFormat = 0x3D,
  1078.     kSelectVDSetInput = 0x3E,
  1079.     kSelectVDGetInput = 0x3F,
  1080.     kSelectVDSetInputStandard = 0x40,
  1081.     kSelectVDSetupBuffers = 0x41,
  1082.     kSelectVDGrabOneFrameAsync = 0x42,
  1083.     kSelectVDDone = 0x43,
  1084.     kSelectVDSetCompression = 0x44,
  1085.     kSelectVDCompressOneFrameAsync = 0x45,
  1086.     kSelectVDCompressDone = 0x46,
  1087.     kSelectVDReleaseCompressBuffer = 0x47,
  1088.     kSelectVDGetImageDescription = 0x48,
  1089.     kSelectVDResetCompressSequence = 0x49,
  1090.     kSelectVDSetCompressionOnOff = 0x4A,
  1091.     kSelectVDGetCompressionTypes = 0x4B,
  1092.     kSelectVDSetTimeBase = 0x4C,
  1093.     kSelectVDSetFrameRate = 0x4D,
  1094.     kSelectVDGetDataRate = 0x4E,
  1095.     kSelectVDGetSoundInputDriver = 0x4F,
  1096.     kSelectVDGetDMADepths = 0x50,
  1097.     kSelectVDGetPreferredTimeScale = 0x51,
  1098.     kSelectVDReleaseAsyncBuffers = 0x52 
  1099. };
  1100. #define    StandardCompressionType        'scdi'
  1101. #define    StandardCompressionSubType    'imag'
  1102.  
  1103.  
  1104. typedef pascal Boolean (*SCModalFilterProcPtr)(DialogPtr theDialog,
  1105.     EventRecord *theEvent, short *itemHit, long refcon);
  1106.  
  1107. typedef pascal short (*SCModalHookProcPtr)(DialogPtr theDialog,
  1108.     short itemHit, void *params, long refcon);
  1109.  
  1110.  
  1111. //    Preference flags.
  1112.  
  1113. #define    scListEveryCodec        (1L<<1)
  1114. #define    scAllowZeroFrameRate    (1L<<2)
  1115. #define    scAllowZeroKeyFrameRate    (1L<<3)
  1116. #define    scShowBestDepth            (1L<<4)
  1117. #define    scUseMovableModal        (1L<<5)
  1118.  
  1119.  
  1120. //    Possible test flags for setting test image.
  1121.  
  1122. #define    scPreferCropping            (1<<0)
  1123. #define    scPreferScaling                (1<<1)
  1124. #define scPreferScalingAndCropping    (scPreferScaling + scPreferCropping)
  1125.  
  1126.  
  1127. //    Dimensions of the image preview box.
  1128.  
  1129. #define    scTestImageWidth    80
  1130. #define    scTestImageHeight    80
  1131.  
  1132.  
  1133. //    Possible items returned by hookProc.
  1134.  
  1135. #define    scOKItem                1
  1136. #define    scCancelItem            2
  1137. #define    scCustomItem            3
  1138.  
  1139. //    Result returned when user cancelled.
  1140.  
  1141. #define    scUserCancelled            1
  1142.  
  1143.  
  1144. // Component selectors
  1145.  
  1146. #define    scPositionRect                2
  1147. #define    scPositionDialog            3
  1148. #define    scSetTestImagePictHandle    4
  1149. #define    scSetTestImagePictFile        5
  1150. #define    scSetTestImagePixMap        6
  1151. #define    scGetBestDeviceRect            7
  1152.  
  1153. #define    scRequestImageSettings        10
  1154. #define    scCompressImage                11
  1155. #define    scCompressPicture            12
  1156. #define    scCompressPictureFile        13
  1157. #define    scRequestSequenceSettings    14
  1158. #define    scCompressSequenceBegin        15
  1159. #define    scCompressSequenceFrame        16
  1160. #define    scCompressSequenceEnd        17
  1161. #define    scDefaultPictHandleSettings    18
  1162. #define    scDefaultPictFileSettings    19
  1163. #define    scDefaultPixMapSettings        20
  1164. #define    scGetInfo                    21
  1165. #define    scSetInfo                    22
  1166. #define    scNewGWorld                    23
  1167.  
  1168.  
  1169. //    Get/SetInfo structures.
  1170.  
  1171. typedef struct {
  1172.     CodecType        codecType;
  1173.     CodecComponent    codec;
  1174.     short            depth;
  1175.     CodecQ            spatialQuality;
  1176. } SCSpatialSettings;
  1177.  
  1178. typedef struct {
  1179.     CodecQ            temporalQuality;
  1180.     Fixed            frameRate;
  1181.     long            keyFrameRate;
  1182. } SCTemporalSettings;
  1183.  
  1184. typedef struct {
  1185.     long            dataRate;
  1186.     long            frameDuration;
  1187.     CodecQ            minSpatialQuality;
  1188.     CodecQ            minTemporalQuality;
  1189. } SCDataRateSettings;
  1190.  
  1191. typedef struct {
  1192.     SCModalFilterProcPtr    filterProc;
  1193.     SCModalHookProcPtr        hookProc;
  1194.     long                    refcon;
  1195.     Str31                    customName;
  1196. } SCExtendedProcs;
  1197.  
  1198.  
  1199. //    Get/SetInfo selectors
  1200.  
  1201. #define    scSpatialSettingsType    'sptl'        // pointer to SCSpatialSettings struct
  1202. #define    scTemporalSettingsType    'tprl'        // pointer to SCTemporalSettings struct
  1203. #define    scDataRateSettingsType    'drat'        // pointer to SCDataRateSettings struct
  1204. #define    scColorTableType        'clut'        // pointer to CTabHandle
  1205. #define    scProgressProcType        'prog'        // pointer to ProgressRecord struct
  1206. #define    scExtendedProcsType        'xprc'        // pointer to SCExtendedProcs struct
  1207. #define    scPreferenceFlagsType    'pref'        // pointer to long
  1208. #define    scSettingsStateType        'ssta'        // pointer to Handle
  1209. #define    scSequenceIDType        'sequ'        // pointer to ImageSequence
  1210. #define    scWindowPositionType    'wndw'        // pointer to Point
  1211. #define    scCodecFlagsType        'cflg'        // pointer to CodecFlags
  1212.  
  1213.  
  1214. //    Result returned by Get/SetInfo when type cannot be found.
  1215.  
  1216. #define    scTypeNotFoundErr        -8971        // same number as codecExtensionNotFoundErr
  1217.  
  1218.  
  1219.  
  1220. #ifdef __cplusplus
  1221. extern "C" {
  1222. #endif
  1223.  
  1224. pascal ComponentResult
  1225. SCPositionRect(ComponentInstance ci,Rect *rp,Point *where)
  1226.     = {0x2F3C,0x8,0x2,0x7000,0xA82A};
  1227.  
  1228. pascal ComponentResult
  1229. SCPositionDialog(ComponentInstance ci,short id,Point *where)
  1230.     = {0x2F3C,0x6,0x3,0x7000,0xA82A};
  1231.  
  1232. pascal ComponentResult
  1233. SCSetTestImagePictHandle(ComponentInstance ci, PicHandle testPict, Rect *testRect, short testFlags)
  1234.     = {0x2F3C,0xA,0x4,0x7000,0xA82A};
  1235.  
  1236. pascal ComponentResult
  1237. SCSetTestImagePictFile(ComponentInstance ci, short testFileRef, Rect *testRect, short testFlags)
  1238.     = {0x2F3C,0x8,0x5,0x7000,0xA82A};
  1239.  
  1240. pascal ComponentResult
  1241. SCSetTestImagePixMap(ComponentInstance ci, PixMapHandle testPixMap, Rect *testRect, short testFlags)
  1242.     = {0x2F3C,0xA,0x6,0x7000,0xA82A};
  1243.  
  1244. pascal ComponentResult
  1245. SCGetBestDeviceRect(ComponentInstance ci, Rect *r) 
  1246.      = {0x2F3C,0x4,0x7,0x7000,0xA82A};
  1247.  
  1248.  
  1249.  
  1250. pascal ComponentResult
  1251. SCRequestImageSettings(ComponentInstance ci)
  1252.     = {0x2F3C,0,0xA,0x7000,0xA82A};
  1253.  
  1254. pascal ComponentResult
  1255. SCCompressImage(ComponentInstance ci,PixMapHandle src,Rect *srcRect,ImageDescriptionHandle *desc,Handle *data)
  1256.     = {0x2F3C,0x10,0xB,0x7000,0xA82A};
  1257.  
  1258. pascal ComponentResult
  1259. SCCompressPicture(ComponentInstance ci,PicHandle srcPicture,PicHandle dstPicture)
  1260.     = {0x2F3C,0x8,0xC,0x7000,0xA82A};
  1261.  
  1262. pascal ComponentResult
  1263. SCCompressPictureFile(ComponentInstance ci,short srcRefNum,short dstRefNum)
  1264.     = {0x2F3C,0x4,0xD,0x7000,0xA82A};
  1265.  
  1266. pascal ComponentResult
  1267. SCRequestSequenceSettings(ComponentInstance ci)
  1268.     = {0x2F3C,0,0xE,0x7000,0xA82A};
  1269.  
  1270. pascal ComponentResult
  1271. SCCompressSequenceBegin(ComponentInstance ci,PixMapHandle src,Rect *srcRect,ImageDescriptionHandle *desc)
  1272.     = {0x2F3C,0xC,0xF,0x7000,0xA82A};
  1273.  
  1274. pascal ComponentResult
  1275. SCCompressSequenceFrame(ComponentInstance ci,PixMapHandle src,Rect *srcRect,Handle *data,long *dataSize,short *notSyncFlag)
  1276.     = {0x2F3C,0x14,0x10,0x7000,0xA82A};
  1277.  
  1278. pascal ComponentResult
  1279. SCCompressSequenceEnd(ComponentInstance ci)
  1280.     = {0x2F3C,0,0x11,0x7000,0xA82A};
  1281.  
  1282. pascal ComponentResult
  1283. SCDefaultPictHandleSettings(ComponentInstance ci,PicHandle srcPicture, short motion)
  1284.     = {0x2F3C,0x6,0x12,0x7000,0xA82A};
  1285.  
  1286. pascal ComponentResult
  1287. SCDefaultPictFileSettings(ComponentInstance ci,short srcRef, short motion)
  1288.     = {0x2F3C,0x4,0x13,0x7000,0xA82A};
  1289.  
  1290. pascal ComponentResult
  1291. SCDefaultPixMapSettings(ComponentInstance ci,PixMapHandle src, short motion)
  1292.     = {0x2F3C,0x6,0x14,0x7000,0xA82A};
  1293.  
  1294. pascal ComponentResult
  1295. SCGetInfo(ComponentInstance ci,OSType type,void *info)
  1296.     = {0x2F3C,0x8,0x15,0x7000,0xA82A};
  1297.  
  1298. pascal ComponentResult
  1299. SCSetInfo(ComponentInstance ci,OSType type,void *info)
  1300.     = {0x2F3C,0x8,0x16,0x7000,0xA82A};
  1301.  
  1302. pascal ComponentResult
  1303. SCNewGWorld(ComponentInstance ci,GWorldPtr *gwp,Rect *rp,GWorldFlags flags)
  1304.     = {0x2F3C,0xC,0x17,0x7000,0xA82A};
  1305.  
  1306. #ifdef __cplusplus
  1307. }
  1308. #endif
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314. // For compatibility with earlier linked StdCompression.
  1315.  
  1316. typedef struct {
  1317.     long            flags;
  1318.     CodecType        theCodecType;
  1319.     CodecComponent    theCodec;
  1320.     CodecQ            spatialQuality;
  1321.     CodecQ            temporalQuality;
  1322.     short            depth;
  1323.     Fixed            frameRate;
  1324.     long            keyFrameRate;
  1325.     long            reserved1;
  1326.     long            reserved2;
  1327. } SCParams;
  1328.  
  1329.  
  1330. #define    scGetCompression        1
  1331.  
  1332. #define    scShowMotionSettings    (1L<<0)
  1333.  
  1334. #define    scSettingsChangedItem    -1
  1335.  
  1336.  
  1337. #ifdef __cplusplus
  1338. extern "C" {
  1339. #endif
  1340.  
  1341. pascal ComponentInstance OpenStdCompression(void);
  1342.  
  1343. pascal ComponentResult
  1344. SCGetCompressionExtended(ComponentInstance ci,SCParams *params,Point where,
  1345.     SCModalFilterProcPtr filterProc,SCModalHookProcPtr hookProc,long refcon,StringPtr customName)
  1346.     = {0x2F3C,0x18,0x1,0x7000,0xA82A};
  1347.  
  1348. pascal ComponentResult
  1349. SCGetCompression(ComponentInstance ci,SCParams *params,Point where)
  1350.     = {0x42A7,0x42A7,0x42A7,0x42A7,0x2F3C,0x18,0x1,0x7000,0xA82A};
  1351.  
  1352. #ifdef __cplusplus
  1353. }
  1354. #endif
  1355.  
  1356.  
  1357.  
  1358.  
  1359. typedef ComponentInstance MovieImportComponent, MovieExportComponent;
  1360.  
  1361. #define MovieImportType 'eat '
  1362. #define MovieExportType 'spit'
  1363.  
  1364. enum {
  1365.     canMovieImportHandles = 1,
  1366.     canMovieImportFiles = 2,
  1367.     hasMovieImportUserInterface = 4,
  1368.     canMovieExportHandles = 8,
  1369.     canMovieExportFiles = 16,
  1370.     hasMovieExportUserInterface = 32,
  1371.     dontAutoFileMovieImport = 64
  1372. };
  1373.  
  1374. enum {
  1375.     kMovieImportExportOpenSelect = kComponentOpenSelect,
  1376.     kMovieImportExportCloseSelect = kComponentCloseSelect,
  1377.     kMovieImportExportCanDoSelect = kComponentCanDoSelect,
  1378.     kMovieImportExportVersionSelect = kComponentVersionSelect, 
  1379.  
  1380.     kMovieImportHandleSelect = 1,
  1381.     kMovieImportFileSelect = 2,
  1382.     kMovieImportSetSampleDurationSelect = 3,
  1383.     kMovieImportSetSampleDescriptionSelect = 4,
  1384.     kMovieImportSetMediaFileSelect = 5,
  1385.     kMovieImportSetDimensionsSelect = 6,
  1386.     kMovieImportSetChunkSizeSelect = 7,
  1387.     kMovieImportSetProgressProcSelect = 8,
  1388.     kMovieImportSetAuxiliaryDataSelect = 9,
  1389.     kMovieImportSetFromScrapSelect = 10,
  1390.     kMovieImportDoUserDialogSelect = 11,
  1391.     kMovieImportSetDurationSelect = 12,
  1392.     
  1393.     kMovieExportToHandleSelect = 128,
  1394.     kMovieExportToFileSelect = 129,
  1395.     kMovieExportDoUserDialogSelect = 130,
  1396.     kMovieExportGetAuxiliaryDataSelect = 131,
  1397.     kMovieExportSetProgressProcSelect = 132
  1398. };
  1399.  
  1400. enum {
  1401.     movieImportCreateTrack = 1,
  1402.     movieImportInParallel = 2,
  1403.     movieImportMustUseTrack = 4
  1404. };
  1405.  
  1406. enum {
  1407.     movieImportResultUsedMultipleTracks = 8
  1408. };
  1409.  
  1410. #ifdef __cplusplus
  1411. extern "C" {
  1412. #endif __cplusplus
  1413.  
  1414. pascal ComponentResult MovieImportHandle(MovieImportComponent ci, Handle dataH,
  1415.         Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration,
  1416.         long inFlags, long *outFlags) = {0x2F3C,0x20,0x1,0x7000,0xA82A};
  1417.  
  1418. pascal ComponentResult MovieImportFile(MovieImportComponent ci, const FSSpec *theFile,
  1419.         Movie theMovie, Track targetTrack, Track *usedTrack, TimeValue atTime, TimeValue *addedDuration,
  1420.         long inFlags, long *outFlags) = {0x2F3C,0x20,0x2,0x7000,0xA82A};
  1421.  
  1422. pascal ComponentResult MovieImportSetSampleDuration(MovieImportComponent ci, TimeValue duration, TimeScale scale) = {0x2F3C,0x8,0x3,0x7000,0xA82A};
  1423.  
  1424. pascal ComponentResult MovieImportSetSampleDescription(MovieImportComponent ci, SampleDescriptionHandle desc, OSType mediaType) = {0x2F3C,0x8,0x4,0x7000,0xA82A};
  1425.  
  1426. pascal ComponentResult MovieImportSetMediaFile(MovieImportComponent ci, AliasHandle alias) = {0x2F3C,0x4,0x5,0x7000,0xA82A};
  1427.  
  1428. pascal ComponentResult MovieImportSetDimensions(MovieImportComponent ci, Fixed width, Fixed height) = {0x2F3C,0x8,0x6,0x7000,0xA82A};
  1429.  
  1430. pascal ComponentResult MovieImportSetChunkSize(MovieImportComponent ci, long chunkSize) = {0x2F3C,0x4,0x7,0x7000,0xA82A};
  1431.  
  1432. pascal ComponentResult MovieImportSetProgressProc(MovieImportComponent ci, MovieProgressProcPtr proc, long refcon) = {0x2F3C,0x8,0x8,0x7000,0xA82A};
  1433.  
  1434. pascal ComponentResult MovieImportSetAuxiliaryData(MovieImportComponent ci, Handle data, OSType handleType) = {0x2F3C,0x8,0x9,0x7000,0xA82A};
  1435.  
  1436. pascal ComponentResult MovieImportSetFromScrap(MovieImportComponent ci, Boolean fromScrap) = {0x2F3C,0x2,0xA,0x7000,0xA82A};
  1437.  
  1438. pascal ComponentResult MovieImportDoUserDialog(MovieImportComponent ci, const FSSpec *theFile, Handle theData, Boolean *canceled) = {0x2F3C,0xC,0xB,0x7000,0xA82A};
  1439.  
  1440. pascal ComponentResult MovieImportSetDuration(MovieImportComponent ci, TimeValue duration) = {0x2F3C,0x4,0xC,0x7000,0xA82A};
  1441.  
  1442.  
  1443. pascal ComponentResult MovieExportToHandle(MovieExportComponent ci, Handle dataH, Movie theMovie, Track onlyThisTrack, TimeValue startTime,
  1444.     TimeValue duration) = {0x2F3C,0x14,0x80,0x7000,0xA82A};
  1445.  
  1446. pascal ComponentResult MovieExportToFile(MovieExportComponent ci, const FSSpec *theFile, Movie theMovie, Track onlyThisTrack, TimeValue startTime,
  1447.     TimeValue duration) = {0x2F3C,0x14,0x81,0x7000,0xA82A};
  1448.  
  1449. pascal ComponentResult MovieExportDoUserDialog(MovieExportComponent ci, const FSSpec *theFile, Handle theData, Boolean *canceled) = {0x2F3C,0xC,0x82,0x7000,0xA82A};
  1450.  
  1451. pascal ComponentResult MovieExportGetAuxiliaryData(MovieExportComponent ci, Handle dataH, OSType *handleType) = {0x2F3C,0x8,0x83,0x7000,0xA82A};
  1452.  
  1453. pascal ComponentResult MovieExportSetProgressProc(MovieExportComponent ci, MovieProgressProcPtr proc, long refcon) = {0x2F3C,0x8,0x84,0x7000,0xA82A};
  1454.  
  1455. #ifdef __cplusplus
  1456. }
  1457. #endif __cplusplus
  1458.  
  1459. /***************
  1460.  
  1461.     File Preview Components
  1462.  
  1463. ***************/
  1464.  
  1465. typedef ComponentInstance pnotComponent;
  1466.  
  1467. enum {
  1468.     pnotComponentWantsEvents = 1,
  1469.     pnotComponentNeedsNoCache = 2
  1470. };
  1471.  
  1472. enum {
  1473.     kPreviewOpenSelector = 0,
  1474.     kPreviewCloseSelector = -1,
  1475.     kPreviewCanDoSelector = -2,
  1476.     kPreviewVersionSelector = -3, 
  1477.  
  1478.     kPreviewShowDataSelector = 1,
  1479.     kPreviewMakePreviewSelector = 2,
  1480.     kPreviewMakePreviewReferenceSelector = 3,
  1481.     kPreviewEventSelector = 4
  1482. };
  1483.  
  1484. #define ShowFilePreviewComponentType 'pnot'
  1485. #define CreateFilePreviewrComponentType 'pmak'
  1486.  
  1487. #ifdef __cplusplus
  1488. extern "C" {
  1489. #endif __cplusplus
  1490.  
  1491. pascal ComponentResult PreviewShowData(pnotComponent p, OSType dataType, Handle data,
  1492.         const Rect *inHere) = {0x2F3C,0xC,0x1,0x7000,0xA82A};
  1493.  
  1494. pascal ComponentResult PreviewMakePreview(pnotComponent p, OSType *previewType, Handle *previewResult,
  1495.             const FSSpec *sourceFile, ProgressProcRecordPtr progress) = {0x2F3C,0x10,0x2,0x7000,0xA82A};
  1496.  
  1497. pascal ComponentResult PreviewMakePreviewReference(pnotComponent p, OSType *previewType, short *resID,
  1498.             const FSSpec *sourceFile) = {0x2F3C,0xC,0x3,0x7000,0xA82A};
  1499.  
  1500. pascal ComponentResult PreviewEvent(pnotComponent p, EventRecord *e, Boolean *handledEvent) = {0x2F3C,0x8,0x4,0x7000,0xA82A};
  1501. #ifdef __cplusplus
  1502. }
  1503. #endif __cplusplus
  1504. #endif __QUICKTIMECOMPONENTS__
  1505.